/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kallsonys.object;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author alladiab
 */
@Entity
@Table(name = "ORDERQUOTE")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Orderquote.findAll", query = "SELECT o FROM Orderquote o"),
    @NamedQuery(name = "Orderquote.findByOrderquoteid", query = "SELECT o FROM Orderquote o WHERE o.orderquoteid = :orderquoteid"),
    @NamedQuery(name = "Orderquote.findByHasexistences", query = "SELECT o FROM Orderquote o WHERE o.hasexistences = :hasexistences"),
    @NamedQuery(name = "Orderquote.findByQuoteprice", query = "SELECT o FROM Orderquote o WHERE o.quoteprice = :quoteprice"),
    @NamedQuery(name = "Orderquote.findByOrderid", query = "SELECT o FROM Orderquote o WHERE o.orderid = :orderid"),
    @NamedQuery(name = "Orderquote.findByIsselected", query = "SELECT o FROM Orderquote o WHERE o.isselected = :isselected")})
public class Orderquote implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "ORDERQUOTEID")
    private Long orderquoteid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "HASEXISTENCES")
    private short hasexistences;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @NotNull
    @Column(name = "QUOTEPRICE")
    private BigDecimal quoteprice;
    @Basic(optional = false)
    @NotNull
    @Column(name = "ISSELECTED")
    private short isselected;
    @JoinColumn(name = "SUPPLIERID", referencedColumnName = "SUPPLIERID")
    @ManyToOne(optional = false)
    private Supplier supplierid;
    @JoinColumn(name = "ORDERID", referencedColumnName = "ORDERID")
    @ManyToOne(optional = false)
    private OrderOms orderid;

    public Orderquote() {
    }

    public Orderquote(Long orderquoteid) {
        this.orderquoteid = orderquoteid;
    }

    public Orderquote(Long orderquoteid, short hasexistences, BigDecimal quoteprice, short isselected) {
        this.orderquoteid = orderquoteid;
        this.hasexistences = hasexistences;
        this.quoteprice = quoteprice;
        this.isselected = isselected;
    }

    public Long getOrderquoteid() {
        return orderquoteid;
    }

    public void setOrderquoteid(Long orderquoteid) {
        this.orderquoteid = orderquoteid;
    }

    public short getHasexistences() {
        return hasexistences;
    }

    public void setHasexistences(short hasexistences) {
        this.hasexistences = hasexistences;
    }

    public BigDecimal getQuoteprice() {
        return quoteprice;
    }

    public void setQuoteprice(BigDecimal quoteprice) {
        this.quoteprice = quoteprice;
    }

    public short getIsselected() {
        return isselected;
    }

    public void setIsselected(short isselected) {
        this.isselected = isselected;
    }

    public Supplier getSupplierid() {
        return supplierid;
    }

    public void setSupplierid(Supplier supplierid) {
        this.supplierid = supplierid;
    }

    public OrderOms getOrderid() {
        return orderid;
    }

    public void setOrderid(OrderOms orderid) {
        this.orderid = orderid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (orderquoteid != null ? orderquoteid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Orderquote)) {
            return false;
        }
        Orderquote other = (Orderquote) object;
        if ((this.orderquoteid == null && other.orderquoteid != null) || (this.orderquoteid != null && !this.orderquoteid.equals(other.orderquoteid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.kallsonys.object.Orderquote[ orderquoteid=" + orderquoteid + " ]";
    }
    
}
